package com.baizhiedu.baizhiappsys.orm;

import com.baizhiedu.baizhiappsys.entity.AdminAccount;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author lby
 * 管理员账号映射
 */
public class AdminAccountRowMapper implements RowMapper<AdminAccount> {
    @Nullable
    @Override
    public AdminAccount mapRow(ResultSet resultSet, int i) throws SQLException {
        Integer id = resultSet.getInt(1);
        String username = resultSet.getString(2);
        String password = resultSet.getString(3);
        return new AdminAccount(id,username,password);
    }
}
